<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class OrderItemsResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'product_id' => $this->product_id,
            'amount' => $this->amount,
            'price' => $this->price,
            'product_sku_name' => $this->product_sku_name,
            'title' => $this->product_title,
            'image' => $this->product_image,
            'after_sale_status' => $this->after_sale_status,  // 售后状态
            'after_sale_is_time' => $this->after_sale_is_time,  // 售后时间是否超出
        ];
    }
}
